<template>
  <div>
    <elm-page-tb>
      <template #top>
        <elm-row>
          <el-input placeholder="销售批次" size="mini" prefix-icon='el-icon-search' style="margin: 0 10px" v-model="postData.name" clearable></el-input>
          <elm-select placeholder="货物名称" size="mini" v-model="postData.dict" style="margin: 0 10px" url="/business/jxc/goods/dict/GetData" clearable></elm-select>
          <el-date-picker placeholder="起始日期" type="date" value-format="yyyy-MM-dd" size="mini" style="margin: 0 10px" v-model="postData.startDate" clearable></el-date-picker>
          <el-date-picker placeholder="结束日期" type="date" value-format="yyyy-MM-dd" size="mini" style="margin: 0 10px" v-model="postData.endDate" clearable></el-date-picker>
          <right>
            <el-button-group>
              <el-button icon="el-icon-search" size="mini" @click="tablebinding()">查询</el-button>
              <elm-open-button url="goods_out_edit" title="新增"  width="80%" height="80%">新增</elm-open-button>
            </el-button-group>
          </right>
        </elm-row>
      </template>
      <elm-table url="/business/jxc/goods/out/GetData" :post-data="postData" :page-size="10" height="100%">
        <el-table-column prop="name" label="销售批次" align="center" header-align="center"></el-table-column>
        <el-table-column prop="dict_mc" label="货物名称" align="center" header-align="center"></el-table-column>
        <el-table-column prop="unit" label="单位" align="center" header-align="center"></el-table-column>
        <el-table-column prop="quantity" label="销售数量" align="right" header-align="center"></el-table-column>
        <el-table-column prop="price" label="销售价格" align="right" header-align="center"></el-table-column>
        <el-table-column prop="tex" label="税率" align="center" header-align="center">
          <template v-slot="scope">
            {{scope.row.tex?scope.row.tex+"%":""}}
          </template>
        </el-table-column>
        <el-table-column prop="out_time" label="出库时间" align="center" header-align="center" :formatter="formatDateTime" width="160"></el-table-column>
        <el-table-column prop="out_person_mc" label="出库员" align="center" header-align="center" width="100"></el-table-column>
        <el-table-column prop="remarks" label="备注" align="center" header-align="center" width="200px"></el-table-column>
        <el-table-column fixed="right" label="操作" width="80px" align="center">
          <template v-slot="scope">
            <elm-open-button url="goods_out_stage" title="查看详情"  width="80%" height="60%" :data="{ out_id: scope.row.id }" type="text">查看详情</elm-open-button>
          </template>
        </el-table-column>
      </elm-table>
    </elm-page-tb>
  </div>

</template>

<script>
export default {
  extends: elmVueBase,
  data() {
    return {
      postData: {
        name: null,
        startDate:new Date(new Date().setDate(1)).toISOString().split('T')[0],
        endDate: new Date().toISOString().split('T')[0],
      }
    }
  },
  created() {
  },
  methods: {
  }
}
</script>
